package com.fc.common.api.mapper;



import com.fc.common.api.vo.Dict;
import com.fc.common.api.vo.DictItem;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface CommonMapper {
    String getDict(Map<String, Object> map);

    /**
     * 获得所有启用的字典
     * @return
     */
    @Select(" select id, dict_code as dic_code from dict where del_flag = '0' ")
    List<Dict> selectDicts();

    /**
     * 根据字典Id获取所有字典项
     * @param id
     * @return
     */
    @Select(" select item_text as text, item_value as value from dict_item where dict_id = #{id} ")
    List<DictItem> selectDictByDictId(@Param("id") String id);
}
